<template>
      <el-form :model="chaStaDetForm" ref="chaStaDetForm" :inline="true" label-width="72px" :label-position="'left'">
        <el-row class="search-title">条件搜索</el-row>
        <el-form-item prop="standard_name">
          <el-input prefix-icon="el-icon-search" v-model="chaStaDetForm.standard_name" placeholder="收费大类"></el-input>
        </el-form-item>
        <el-form-item prop="account_sdate" label="生效时间">
          <el-date-picker v-model="chaStaDetForm.standard_qstime"
                          type="datetimerange"
                          value-format= "yyyy-MM-dd hh:mm:ss"
                          range-separator="-"
                          start-placeholder="开始"
                          end-placeholder="结束">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button class="btn-mini-form"  @click="submitForm(chaStaDetForm)"
                     size="mini" >提交
          </el-button>
          <el-button class="btn-mini-form"  @click="resetForm(chaStaDetForm)"
                     size="mini" >重置
          </el-button>
        </el-form-item>
      </el-form>
</template>
<script>
  import { selDictonary, selDictonaryValue } from '../../../api/dictionary'
  import { selectChargeStandard } from '../../../api/chargeStandard'

  // import ElFormItem from "element-ui/packages/form/src/form-item";
  // import CollapseVertical from '../../../utils/collapseVertical'
  export default {
    name: 'charge-standard-form',
    components: {
      // ElFormItem,
      // CollapseVertical
    },
    data() {
      return {
          chaStaDetForm : {
             standard_name: '', // 收费大类
             standard_qstime: '',
             standard_qetime: '',
          }
      }
    },
    props: ['pageNum', 'ranNum','pageSize'],
    watch: {
      pageNum: function(val) {
        this.submitForm();
      },
      ranNum: function(val) {
        this.submitForm();
      },
      pageSize: function(val) {
        this.submitForm();
      },
    },
    mounted : function() {
        this.submitForm();
    },
    methods: {
      submitForm: function() {
        selectChargeStandard(this.chaStaDetForm, this.pageNum,this.pageSize).then(res => {
          selDictonaryValue(res).then(resp => {
            this.$emit('tableData', resp)
            this.$emit('tableLoad', false);
          })
       })
      },
      resetForm(chaStaDetForm) {  // 清空form
        this.$refs[chaStaDetForm].resetFields()
      },
    }
}
</script>

<style scoped>
</style>
